package cn.com.bluemoon.daps.system.entity;

import cn.com.bluemoon.daps.common.enums.BmStatus;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统业务线
 * </p>
 *
 * @author admin
 * @since 2021-09-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors
@ApiModel(value = "DapSystemBizLine", description = "系统业务线")
public class DapSystemBizLine extends Model<DapSystemBizLine> implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer bizLineId;

    @ApiModelProperty(value = "业务线代/编码")
    private String code;

    @ApiModelProperty(value = "业务线名称")
    private String codeName;

    @ApiModelProperty(value = "全称")
    private String fullName;

    @ApiModelProperty(value = "说明")
    private String remark;

    @ApiModelProperty(value = "业务线（数据）负责人，存工号，只一个")
    @Size(max = 50)
    private String dataManager;

    @ApiModelProperty(value = "etl队列名")
    @Size(max = 255)
    private String etlQueueName;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人", hidden = true)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "修改人", hidden = true)
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "最后更新时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "表数据状态: -1:删除 0:禁用 1:启用", hidden = true)
    @EnumValue
    private BmStatus bmStatus = BmStatus.ON;

    @Override
    protected Serializable pkVal() {
        return bizLineId;
    }
}
